def isEmpty(v):
    pass

def emit(*args):
    pass

def map(current_node, hs):
    emit(hs, 0)

def filter(kv):
    return isEmpty(kv.key) == False

def reduce(key, vals):
    val = max(vals)
    emit(key, val)

def transition(current_node, eg, kv):
    emit(kv.key ^ eg.hs, kv.val + 1)

def monitor(kv):
    assert(kv.val <= 2)